public class Test {
    public static void main(String[] args) {
        //向上转型
        Animal animal=new Dog();
        animal.sound();
        //向下转型
        Dog dog=(Dog) animal;
        dog.sleep();;
        ((Dog) animal).sleep();
    }
}
